package com.itheima.Logicoperator;

public class LogicoperatorDemo2 {
    public static void main(String[] args) {
        //短路与&&，与&结果一样
        System.out.println(true && true);
        System.out.println(true && false);
        System.out.println(false && true);
        System.out.println(false && false);

        //短路或||
        System.out.println(true || true);
        System.out.println(true || false);
        System.out.println(false || true);
        System.out.println(false || false);

        int a = 10;
        int b = 20;
        boolean result = ++a < 5 && ++b < 5;
        //&&左边已经能确定结果了，则不用执行&&右边了，即b不实现自增
        System.out.println(result);
        System.out.println(a);//11
        System.out.println(b);//20

    }
}
